
#include "MainWindow.h"

using namespace std;

int bl[2] = {100, 100};

MainWindow::MainWindow(string title, int size_x, int size_y, char flags) : MyBaseWindow( title, size_x, size_y, flags ), cam_rot_enabled_(false),
																																	main_viewport_(-0.9f, -0.5f, 1.8f, 0.5f, window_size_),
																																	button_( "Wireframe", 0.0f, 0.0f, 0.1f, 0.1f, window_size_ ),
																																	toolbar_( 0.0, 0.0, 0.0, 0.0, 3, window_size_),
																																	menu_( "File", 0.0f, 0.8f, 0.8f, window_size_ ),
																																	menu2_( "Edit", 0.0f, 0.8f, 0.8f, window_size_ ),
																																	menu3_( "View", 0.0f, 0.8f, 0.8f, window_size_ ),
																																	layout3_( -1.0f, -1.0f, 2.0f, 0.4f, window_size_, false ),
																																	edit_text_( "text", 0.0f, 0.0f, 0.5f, 0.1f, 1.0f, window_size_, FLOATS | MULTILINE ){


		button_pressed_slot_.AssignFunction( this, &MainWindow::ButtonProc );
		//button_->Connect( button_pressed_slot_ );
		button_pressed_slot_.Connect( button_.press_signal() );

		//menu_ = new MyDropMenu( "File", 0.0f, 0.8f, 0.8f, window_size_ );
		menu_.AddItem( "New           ", button_pressed_slot_ );
		menu_.AddItem( "Open", button_pressed_slot_ );
		menu_.AddItem( "Save", button_pressed_slot_ );

		//menu2_ = new MyDropMenu( "������", 0.0f, 0.8f, 0.8f, window_size_ );
		menu2_.AddItem( "1", button_pressed_slot_ );
		menu2_.AddItem( "22", button_pressed_slot_ );
		menu2_.AddItem( "333", button_pressed_slot_ );
		menu2_.AddItem( "-------------", button_pressed_slot_ );
		menu2_.AddItem( "4444", button_pressed_slot_ );
		menu2_.AddItem( "55555", button_pressed_slot_ );

		//menu3_.reset( new MyDropMenu( "���������", 0.0f, 0.8f, 0.8f, window_size_ ) );
		menu3_.AddItem( "1", button_pressed_slot_ );
		menu3_.AddItem( "22", button_pressed_slot_ );
		menu3_.AddItem( "333", button_pressed_slot_ );
		menu3_.AddItem( "-------------", button_pressed_slot_ );
		menu3_.AddItem( "4444", button_pressed_slot_ );
		menu3_.AddItem( "55555", button_pressed_slot_ );

		//layout3_ = new MyLinearLayout( -1.0f, -1.0f, 2.0f, 0.4f, window_size_, false );
		layout3_.AddElement( &menu_ );
		layout3_.AddElement( &menu2_ );
		layout3_.AddElement( &menu3_ );

		//edit_text_.reset( new MyEditBox( "text", 0.0f, 0.0f, 0.5f, 0.1f, 1.0f, window_size_, FLOATS | MULTILINE ) );
		//edit_text_->AddLine( "text1" );
		edit_text_.AddChar( '1' );

		update_needed_ = true;
		OnMove( 0.0f, 0.0f );

	}
